#include <iostream>
#include "XorShift.h"

using namespace std;

XSrng::XSrng(){
	x = 123456789;
	y = 362436069;
	z = 521288629;
	w = 88675123;
}

unsigned int XSrng::getNext(){
	t = x ^ (x << 11);
	x = y;
	y = z;
	z = w;
	w = w ^ (w >> 19) ^ (t ^ (t >> 8));
	return w;
}

unsigned int XSrng::getNext(unsigned int min, unsigned int max){
	t = x ^ (x << 11);
	x = y;
	y = z;
	z = w;
	w = w ^ (w >> 19) ^ (t ^ (t >> 8));
	return w % (max - min + 1) + min;
}